package com.ymatou.iapi.mqcompensate.testcase;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.http.client.ClientProtocolException;
import org.apache.poi.xdgf.usermodel.section.geometry.InfiniteLine;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.mqcompensate.parameter.SecondCompensateBean;
import com.ymatou.iapi.mqcompensate.service.SecondCompensateCall;
import com.ymatou.iapi.mqpublish.parameter.PublishBean;
import com.ymatou.iapi.mqpublish.service.PublishCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*秒级补单用例
*FreeMaker Template自动生成代码
*/
import com.ymttest.business.service.MqCompensateCallService;
import com.ymttest.business.service.MqPublishCallService;
import com.ymttest.database.mongo.MQMessageBean;
import com.ymttest.database.mongo.MQMessageCompensateBean;
import com.ymttest.database.mongo.MQMessageCompensateWapper;
import com.ymttest.database.mongo.MQMessageStatusBean;
import com.ymttest.database.mongo.MQMessageStatusWapper;
import com.ymttest.database.mongo.MQMessageWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.constant.ECode;

@TestSuite
public class Ts_SecondCompensate {
	private static SecondCompensateBean secondcompensateBean;
	private static SecondCompensateCall secondcompensateCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("秒级补单用例");
	}

	@Before
	public void caseUp() {
		secondcompensateBean = new SecondCompensateBean();
		secondcompensateCall = new SecondCompensateCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(secondcompensateCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_SecondCompensate_001() {
		Logger.start(true, "补发消息-接收成功");
		try {

			SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyyMM");
			String dateStr1 = sDateFormat.format(new java.util.Date());

			String appName = "testbamei";
			String codeName = "miaosiok";

			String uuid = dateStr1 + "." + TestDataManager.getRandomUUID().toString();
			String msguniqueid = TestDataManager.getRandomNum(10);
			String body = TestDataManager.randomStr(20);
			String busIp = "127.0.0.1";

			Date nowTime = new Date();
			Date date = new Date(nowTime.getTime() - 9 * 60 * 60 * 1000);
			Date date3 = new Date(nowTime.getTime() - 8 * 60 * 60 * 1000);
			Date date2 = new Date(nowTime.getTime() - 9 * 60 * 60 * 1000 + 60 * 60 * 1000 + 60 * 1000);
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
			String dateStr = format.format(date);

			String json = "{\"uuid\" : \"" + uuid + "\",\"aid\" : \"" + appName + "\",\"code\" : \"" + codeName + "\","
					+ "\"mid\" : \"" + msguniqueid + "\",\"ip\" : \"127.0.0.1\",\"busIp\" : \"" + busIp + "\","
					+ "\"body\" : \"\\\"" + body + "\\\"\",\"ctime\" : {$date:\"" + dateStr + "\"},"
					+ "\"pushstatus\" : 1000,\"nstatus\" : 0,\"pstatus\" : 0," + "\"pushtime\" : {$date:\"" + dateStr
					+ "\"}}";
			Logger.comment(json);

			new MQMessageWapper().saveData(appName, codeName, json);

			new MqCompensateCallService().CheckToChompensateCall(appName, codeName);

			secondcompensateBean.setAppId(appName);
			secondcompensateBean.setCode(codeName);
			secondcompensateBean.setUuid(uuid);
			secondcompensateBean.setMessageId(msguniqueid);
			secondcompensateBean.setBody(body);
			secondcompensateBean.setConsumerId("testbamei_miaosiok_c0");
			secondcompensateBean.setTimeSpanSecond(1);

			List<MQMessageStatusBean> statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num1 = statusList.size();

			secondcompensateCall.setData(secondcompensateBean);
			secondcompensateCall.callService();

			Thread.sleep(1000);

			// 验证消息成功
			MQMessageBean messageBean = new MQMessageWapper().getMessageByMid(appName, codeName, msguniqueid);

			Logger.verifyEquals(appName, messageBean.getAid(), "验证数据库Aid");
			Logger.verifyEquals(codeName, messageBean.getCode(), "验证数据库Code");
			Logger.verifyEquals(busIp, messageBean.getIp(), "验证数据库Ip");
			Logger.verifyEquals("\"" + body + "\"", messageBean.getBody(), "验证数据库Body");
			Logger.verifyEquals(format.format(date).subSequence(0, 16),
					messageBean.getCtime().toString().subSequence(7, 23), "验证数据库Ctime");
			Logger.verifyEquals(busIp, messageBean.getBusIp(), "验证数据库BusIp");
			Logger.verifyEquals(3, messageBean.getNstatus(), "验证数据库nstatus:3-检测进入补单");
			Logger.verifyEquals(1, messageBean.getPstatus(), "验证数据库pstatus:1-分发成功");

			// 验证补单库
			MQMessageCompensateBean compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName,
					messageBean.getUuid());

			Logger.verifyEquals(messageBean.getAid(), compensate.getAppid(), "验证数据库MQ_Message_Compensate字段AppId");
			Logger.verifyEquals(messageBean.getCode(), compensate.getCode(), "验证数据库MQ_Message_Compensate字段Code");
			Logger.verifyEquals(messageBean.getMid(), compensate.getMid(), "验证数据库MQ_Message_Compensate字段mId");
			// Logger.verifyEquals(format.format(date2).subSequence(0, 16),
			// compensate.getRtimeout().toString().subSequence(7, 23),
			// "验证数据库MQ_Message_Compensate字段Rtimeout");
			Logger.verifyEquals(1, compensate.getRetrycount(), "验证数据库MQ_Message_Compensate字段RetryCount");
			Logger.verifyEquals(3, compensate.getSource(), "验证数据库MQ_Message_Compensate字段Source补单来源:3-补偿站");
			Logger.verifyEquals(2, compensate.getNstatus(), "验证数据库MQ_Message_Compensate字段nStatus:2-补发成功");
			Logger.verifyEquals("testbamei_miaosiok_c0", compensate.getCid(), "验证数据库MQ_Message_Compensate字段Cid");

			// 验证Status表生成记录
			statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num2 = statusList.size();

			Logger.verifyEquals(1, num2 - num1, "验证数据库MQ_Message_Status新生成一条记录");

			MQMessageStatusBean status = statusList.get(num2 - 1);

			SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");

			Logger.verifyEquals(messageBean.getUuid(), status.getUuid(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(messageBean.getMid(), status.getMid(), "验证数据库MQ_Message_Status字段Mid");
			Logger.verifyEquals("testbamei_miaosiok_c0", status.getCid(), "验证数据库MQ_Message_Status字段Cid");
			Logger.verifyEquals("PushOk", status.getStatus(), "验证数据库MQ_Message_Status字段Source");
			Logger.verifyEquals("SecondCompensate", status.getSource(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(true, status.getResult().contains("ok, testbamei_miaosiok_c0"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true,
					status.getResult().contains("http://mockforpay.iapi.ymatou.com/api/messagebus/return/ok"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true, status.getR_ip().contains("135"), "验证数据库MQ_Message_Status字段R_ip");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_SecondCompensate_002() {
		Logger.start(true, "秒级补发消息-接收失败");
		try {

			PublishBean publishBean = new MqPublishCallService().setPublishBeanForRecieveFail();
			publishBean.setCode("miaosi");
			PublishCall publishCall = new MqPublishCallService().publishCall(publishBean);

			new MqCompensateCallService().CheckToChompensateCall(publishBean.getAppId(), publishBean.getCode());

			MQMessageBean result = new MQMessageWapper().getMessageByMid(publishBean.getAppId(), publishBean.getCode(),
					publishBean.getMsgUniqueId());
			secondcompensateBean.setAppId(publishBean.getAppId());
			secondcompensateBean.setCode(publishBean.getCode());

			secondcompensateBean.setUuid(result.getUuid());
			secondcompensateBean.setMessageId(publishBean.getMsgUniqueId());
			secondcompensateBean.setBody(publishBean.getBody());
			secondcompensateBean.setConsumerId("testbamei_miaosiok_c0");
			secondcompensateBean.setTimeSpanSecond(1);

			String appName = publishBean.getAppId();
			String msguniqueid = publishBean.getMsgUniqueId();
			String codeName = publishBean.getCode();

			List<MQMessageStatusBean> statusList = new ArrayList<>();
			statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num1 = statusList.size();

			secondcompensateCall.setData(secondcompensateBean);
			secondcompensateCall.callService();

			Thread.sleep(1000);

			Logger.verifyEquals(ECode.SUCCESS, secondcompensateCall.getCode(), "验证Code");
			Logger.verifyEquals("null", secondcompensateCall.getMsg(), "验证Msg");

			MQMessageBean messageBean = new MQMessageWapper().getMessageByMid(appName, codeName, msguniqueid);

			int flag = 0;

			while (messageBean == null || messageBean.getNstatus() == 0 && flag < 20) {
				Thread.sleep(200);
				flag++;
				messageBean = new MQMessageWapper().getMessageByMid(appName, codeName, msguniqueid);
			}

			Date nowTime = new Date();
			Date date = new Date(nowTime.getTime() - 8 * 60 * 60 * 1000);
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH");

			// 验证消息成功
			Logger.verifyEquals(publishBean.getAppId(), messageBean.getAid(), "验证数据库Aid");
			Logger.verifyEquals(publishBean.getCode(), messageBean.getCode(), "验证数据库Code");
			Logger.verifyEquals(publishBean.getIp(), messageBean.getIp(), "验证数据库Ip");
			Logger.verifyEquals("\"" + publishBean.getBody() + "\"", messageBean.getBody(), "验证数据库Body");
			// Logger.verifyEquals(sdf.format(date),
			// messageBean.getCtime().toString().subSequence(7, 20),
			// "验证数据库Ctime,如果相差1小时，可能是由于换小时引起");
			Logger.verifyEquals(true, messageBean.getBusIp().contains("133"), "验证数据库BusIp");
			Logger.verifyEquals(true, messageBean.getNstatus() == 2 || messageBean.getNstatus() == 3,
					"验证数据库nstatus:0-进入RabbitMQ,2-分发进入补单,3-检测进入补单");
			// Logger.verifyEquals(sdf.format(date),messageBean.getPushtime().toString().subSequence(7,
			// 20), "验证数据库Pushtime,如果相差1小时，可能是由于换小时引起");
			Logger.verifyEquals(2, messageBean.getPstatus(), "验证数据库pstatus:2-补单中");

			// 验证进入补单库
			MQMessageCompensateBean compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName,
					messageBean.getUuid());

			while (compensate == null || compensate.getNstatus() == 0 && flag < 20) {
				Thread.sleep(200);
				flag++;
				compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName,
						messageBean.getUuid());
			}

			Logger.verifyEquals(messageBean.getAid(), compensate.getAppid(), "验证数据库MQ_Message_Compensate字段AppId");
			Logger.verifyEquals(messageBean.getCode(), compensate.getCode(), "验证数据库MQ_Message_Compensate字段Code");
			Logger.verifyEquals(messageBean.getMid(), compensate.getMid(), "验证数据库MQ_Message_Compensate字段mId");
			// Logger.verifyEquals(sdf.format(date),
			// compensate.getRtimeout().toString().subSequence(7, 20),
			// "验证数据库MQ_Message_Compensate字段Rtimeout,如果相差1小时，可能是由于换小时引起");
			Logger.verifyEquals(true, compensate.getSource() == 2 || compensate.getSource() == 3,
					"验证数据库MQ_Message_Compensate字段Source补单来源:1-接收站,2-分发站,3-补偿站");
			Logger.verifyEquals(1, compensate.getNstatus(), "验证数据库MQ_Message_Compensate字段nStatus：1-补发中");
			Logger.verifyEquals("testbamei_miaosi_c0", compensate.getCid(), "验证数据库MQ_Message_Compensate字段Cid");

			// 验证Status表生成记录
			List<MQMessageStatusBean> statusList2 = new ArrayList<>();
			statusList2 = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num2 = statusList2.size();

			int flag2 = 1;
			while (num2 == num1 && flag2 < 5) {
				Thread.sleep(100);
				flag2++;
				statusList2 = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			}
			int num3 = num2 - num1;

			Logger.comment("num2:" + num2 + ",num1:" + num1);
			Logger.verifyEquals(true, num3 >= 1, "验证数据库MQ_Message_Status新生成一条记录");

			MQMessageStatusBean status = statusList2.get(num2 - 1);

			SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd'T'HH");

			Logger.verifyEquals(messageBean.getUuid(), status.getUuid(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(messageBean.getMid(), status.getMid(), "验证数据库MQ_Message_Status字段Mid");
			Logger.verifyEquals("testbamei_miaosi_c0", status.getCid(), "验证数据库MQ_Message_Status字段Cid");
			Logger.verifyEquals("PushFail", status.getStatus(), "验证数据库MQ_Message_Status字段Status");
			Logger.verifyEquals("SecondCompensate", status.getSource(), "验证数据库MQ_Message_Status字段Source");
			// Logger.verifyEquals(sdf2.format(date),
			// status.getCtime().toString().subSequence(7, 20),
			// "验证数据库MQ_Message_Status字段Ctime,如果相差1小时，可能是由于换小时引起");
			Logger.verifyEquals(true, status.getResult().contains("fail, testbamei_miaosi_c0"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true,
					status.getResult().contains("http://mockforpay.iapi.ymatou.com/api/messagebus/return/fail"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true, status.getR_ip().contains("135"), "验证数据库MQ_Message_Status字段R_ip");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_SecondCompensate_003() {
		Logger.start(true, "补发消息-mongo出问题时直接秒补发短信-返回成功");
		try {

			SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyyMM");
			String dateStr1 = sDateFormat.format(new java.util.Date());

			String appName = "testbamei";
			String codeName = "miaosiok";

			String uuid = dateStr1 + "." + TestDataManager.getRandomUUID().toString();
			String msguniqueid = TestDataManager.getRandomNum(10);
			String body = TestDataManager.randomStr(20);
			String busIp = "127.0.0.1";

			secondcompensateBean.setAppId(appName);
			secondcompensateBean.setCode(codeName);
			secondcompensateBean.setUuid(uuid);
			secondcompensateBean.setMessageId(msguniqueid);
			secondcompensateBean.setBody(body);
			secondcompensateBean.setConsumerId("testbamei_miaosiok_c0");
			secondcompensateBean.setTimeSpanSecond(1);

			List<MQMessageStatusBean> statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num1 = statusList.size();

			secondcompensateCall.setData(secondcompensateBean);
			secondcompensateCall.callService();

			// 验证补单库
			MQMessageCompensateBean compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName,
					uuid);

			int flag = 0;
			while (compensate == null || compensate.getNstatus() == 0 && flag < 20) {
				Thread.sleep(200);
				flag++;
				compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName, uuid);
			}

			Logger.verifyEquals(appName, compensate.getAppid(), "验证数据库MQ_Message_Compensate字段AppId");
			Logger.verifyEquals(codeName, compensate.getCode(), "验证数据库MQ_Message_Compensate字段Code");
			Logger.verifyEquals(msguniqueid, compensate.getMid(), "验证数据库MQ_Message_Compensate字段mId");
			// Logger.verifyEquals(format.format(date2).subSequence(0, 16),
			// compensate.getRtimeout().toString().subSequence(7, 23),
			// "验证数据库MQ_Message_Compensate字段Rtimeout");
			Logger.verifyEquals(1, compensate.getRetrycount(), "验证数据库MQ_Message_Compensate字段RetryCount");
			Logger.verifyEquals(3, compensate.getSource(), "验证数据库MQ_Message_Compensate字段Source补单来源:3-补偿站");
			Logger.verifyEquals(2, compensate.getNstatus(), "验证数据库MQ_Message_Compensate字段nStatus:2-补发成功");
			Logger.verifyEquals("testbamei_miaosiok_c0", compensate.getCid(), "验证数据库MQ_Message_Compensate字段Cid");

			// 验证Status表生成记录
			statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num2 = statusList.size();

			Logger.verifyEquals(1, num2, "验证数据库MQ_Message_Status新生成一条记录");

			MQMessageStatusBean status = statusList.get(num2 - 1);

			SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");

			Logger.verifyEquals(uuid, status.getUuid(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(msguniqueid, status.getMid(), "验证数据库MQ_Message_Status字段Mid");
			Logger.verifyEquals("testbamei_miaosiok_c0", status.getCid(), "验证数据库MQ_Message_Status字段Cid");
			Logger.verifyEquals("PushOk", status.getStatus(), "验证数据库MQ_Message_Status字段Source");
			Logger.verifyEquals("SecondCompensate", status.getSource(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(true, status.getResult().contains("ok, testbamei_miaosiok_c0"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true,
					status.getResult().contains("http://mockforpay.iapi.ymatou.com/api/messagebus/return/ok"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true, status.getR_ip().contains("135"), "验证数据库MQ_Message_Status字段R_ip");

			// 验证消息库没有该记录
			MQMessageBean messageBean = new MQMessageWapper().getMessageByMid(appName, codeName, msguniqueid);
			Logger.verifyIsNull(messageBean, "验证消息库没有该记录");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_SecondCompensate_004() {
		Logger.start(true, "补发消息-mongo出问题时直接秒补发短信-返回失败");
		try {

			SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyyMM");
			String dateStr1 = sDateFormat.format(new java.util.Date());

			String appName = "testbamei";
			String codeName = "miaosi";

			String uuid = dateStr1 + "." + TestDataManager.getRandomUUID().toString();
			String msguniqueid = TestDataManager.getRandomNum(10);
			String body = TestDataManager.randomStr(20);
			String busIp = "127.0.0.1";

			secondcompensateBean.setAppId(appName);
			secondcompensateBean.setCode(codeName);
			secondcompensateBean.setUuid(uuid);
			secondcompensateBean.setMessageId(msguniqueid);
			secondcompensateBean.setBody(body);
			secondcompensateBean.setConsumerId("testbamei_miaosi_c0");
			secondcompensateBean.setTimeSpanSecond(1);

			List<MQMessageStatusBean> statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num1 = statusList.size();

			secondcompensateCall.setData(secondcompensateBean);
			secondcompensateCall.callService();

			// 验证补单库
			MQMessageCompensateBean compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName,
					uuid);

			int flag = 0;
			while (compensate == null || compensate.getNstatus() == 0 && flag < 20) {
				Thread.sleep(200);
				flag++;
				compensate = new MQMessageCompensateWapper().getCompensateByUuid(appName, codeName, uuid);
			}

			Logger.verifyEquals(appName, compensate.getAppid(), "验证数据库MQ_Message_Compensate字段AppId");
			Logger.verifyEquals(codeName, compensate.getCode(), "验证数据库MQ_Message_Compensate字段Code");
			Logger.verifyEquals(msguniqueid, compensate.getMid(), "验证数据库MQ_Message_Compensate字段mId");
			// Logger.verifyEquals(format.format(date2).subSequence(0, 16),
			// compensate.getRtimeout().toString().subSequence(7, 23),
			// "验证数据库MQ_Message_Compensate字段Rtimeout");
			Logger.verifyEquals(1, compensate.getRetrycount(), "验证数据库MQ_Message_Compensate字段RetryCount");
			Logger.verifyEquals(3, compensate.getSource(), "验证数据库MQ_Message_Compensate字段Source补单来源:3-补偿站");
			Logger.verifyEquals(1, compensate.getNstatus(), "验证数据库MQ_Message_Compensate字段nStatus:1-补发中");
			Logger.verifyEquals("testbamei_miaosi_c0", compensate.getCid(), "验证数据库MQ_Message_Compensate字段Cid");

			// 验证Status表生成记录
			statusList = new MQMessageStatusWapper().getStatusByMid(appName, msguniqueid);
			int num2 = statusList.size();

			Logger.verifyEquals(1, num2, "验证数据库MQ_Message_Status新生成一条记录");

			MQMessageStatusBean status = statusList.get(num2 - 1);

			SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");

			Logger.verifyEquals(uuid, status.getUuid(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(msguniqueid, status.getMid(), "验证数据库MQ_Message_Status字段Mid");
			Logger.verifyEquals("testbamei_miaosi_c0", status.getCid(), "验证数据库MQ_Message_Status字段Cid");
			Logger.verifyEquals("PushFail", status.getStatus(), "验证数据库MQ_Message_Status字段Source");
			Logger.verifyEquals("SecondCompensate", status.getSource(), "验证数据库MQ_Message_Status字段uuid");
			Logger.verifyEquals(true, status.getResult().contains("fail, testbamei_miaosi_c0"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true,
					status.getResult().contains("http://mockforpay.iapi.ymatou.com/api/messagebus/return/fail"),
					"验证数据库MQ_Message_Status字段Result");
			Logger.verifyEquals(true, status.getR_ip().contains("135"), "验证数据库MQ_Message_Status字段R_ip");

			// 验证消息库没有该记录
			MQMessageBean messageBean = new MQMessageWapper().getMessageByMid(appName, codeName, msguniqueid);
			Logger.verifyIsNull(messageBean, "验证消息库没有该记录");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}